package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;
import com.itheima.service.MemberDeleteService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
public class MemberDelete {
    @Reference
    private MemberDeleteService memberDeleteService;
    //根据id删除检查项
    @RequestMapping("/delete")
    public Result delete(Integer id){
        try{
            memberDeleteService.delete(id);//发送请求
            return new Result(true, MessageConstant.DELETE_MEMBER_SUCCESS);
        }catch (Exception e){
            String message = e.getMessage();
            e.printStackTrace();
            return new Result(false,MessageConstant.DELETE_MEMBER_FAIL);
        }
    }
}
